package lesson2.tests;

import lesson2.api.models.UserData;

import org.testng.Assert;
import org.testng.annotations.Test;

public class RegistrationTest extends TestBase
{
	@Test
	public void registrationWithDataTest()
	{
		UserData userData = new UserData();
		userData.login = "testuser111";
		userData.password = "111111";
		userData.firstName = "Test";
		userData.lastName = "User1";
		userData.email = "testuser111@cupid.com";
		userData.skypeName = "testuser1.skype";
		userData.phone = "1111111111";
		userData.department = "Test team";
		userData.occupation = "Tester";
		userData.language = "sq";

		navigationHelper().openIndexPage();
		pageHelper().indexPage().openRegistrationPage();
		pageHelper().registrationPage().fillRegData(userData);
		pageHelper().registrationPage().submitRegData();

		// Check registration
		Assert.assertTrue(pageHelper().isRegistered(), "User is not registered");
	}

	@Test
	public void registrationWithoutDataTest()
	{
		UserData userData = new UserData();
		userData.login = "";
		userData.password = "";
		userData.firstName = "";
		userData.lastName = "";
		userData.email = "";
		userData.skypeName = "";
		userData.phone = "";
		userData.department = "";
		userData.occupation = "";

		navigationHelper().openIndexPage();
		pageHelper().indexPage().openRegistrationPage();
		pageHelper().registrationPage().fillRegData(userData);
		pageHelper().registrationPage().submitRegData();

		// Check registration
		Assert.assertFalse(pageHelper().isRegistered(), "User is registered");
	}
}
